<template>
  <div>
    <div class="Login">
      <div class="Login_BOX">
        <p>欢迎注册</p>
        <p>严选商城</p>
      </div>
      <div>
        <el-input
          placeholder="请输入内容"
          v-model="mobile"
          clearable
          class="Login_input"
        >
        </el-input>
        <el-input
          placeholder="请输入密码"
          v-model="pwd"
          show-password
          class="Login_input"
        >
        </el-input>
        <el-button type="success" plain class="Login_but" @click="OnLogin"
          >登录</el-button
        >
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      pwd: "",
      mobile: "",
    };
  },
  methods: {
    OnLogin() {
      this.$Api
        .Yanxuan_Login({
          params: {
            pwd: this.pwd,
            mobile: this.mobile,
          },
        })
        .then((res) => {
          var token = res.data.data.token;
          //把获取的token 保存在本地
          localStorage.setItem("token", token);
          alert("登录成功");
          this.$router.push("/mime");
        });
    },
  },
};
</script>、
<style  scoped>
.Login_BOX {
  margin-top: 5rem;
  width: 5rem;
  height: 5rem;
  margin-left: 5rem;
  font-size: 1rem;
  color: #cdcdcd;
  font-weight: 700;
}
.Login {
  width: 100%;
  height: 40rem;
}
.Login_input {
  width: 70%;
  margin-left: 15%;
  margin-top: 10px;
  border: 1px solid springgreen;
  /* border:0; */
}
.Login_but {
  margin-top: 2rem;
  width: 50%;
  margin-left: 25%;
}
</style>